#include "bwtmtool.h"
#include "cloudplatform.h"
#include "./ui_bwtmtool.h"
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QMessageBox>

BWTMTool::BWTMTool(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::BWTMTool)
{
    ui->setupUi(this);

//    QVBoxLayout *p1 = new QVBoxLayout(ui->page_2);
//    p1->addWidget(ui->pushButton);

    //QVBoxLayout *p2 = new QVBoxLayout(ui->wd_cloudPlatform);
    //p2->addWidget(ui->);

    ui->stackedWidget->addWidget(ui->wd_idcPlatform);
    ui->stackedWidget->addWidget(ui->wd_cloudPlatform);

    QVBoxLayout *p3 = new QVBoxLayout();
    p3->addWidget(ui->stackedWidget);
    this->centralWidget()->setLayout(p3);
    ui->stackedWidget->setCurrentWidget(ui->wd_cloudPlatform);
}

BWTMTool::~BWTMTool()
{
    delete ui;
}


void BWTMTool::on_action_CloudPlatform_triggered()
{
    //CloudPlatform cpf;
    ui->stackedWidget->setCurrentWidget(ui->wd_cloudPlatform);
}

void BWTMTool::on_action_IDCCustomer_triggered()
{
    ui->wd_idcPlatform->setPlatFormFlag("IDC客户");
    ui->stackedWidget->setCurrentWidget(ui->wd_idcPlatform);
}


void BWTMTool::on_action_IDCSupplier_triggered()
{
    ui->wd_idcPlatform->setPlatFormFlag("IDC供应商");
    ui->stackedWidget->setCurrentWidget(ui->wd_idcPlatform);
}


void BWTMTool::on_action_Exit_triggered()
{
    QMessageBox::StandardButton result= QMessageBox::question(this,"提示","确定要退出?");
    if(result==QMessageBox::Yes)
        close();

}


void BWTMTool::on_action_CheckUpdate_triggered()
{
    QMessageBox::information(this, "提示","当前是最新版本！");
}

